package ru.ssau.university.persistence.dao;

import org.hibernate.Query;

import ru.ssau.hibernate.util.AbstractDAO;
import ru.ssau.university.persistence.entity.Admin;

public class AdminDAO extends AbstractDAO<Admin>{
	public AdminDAO() {
		this.objectClass = Admin.class;
	}
	
	public Admin getAdminBy(String userName, String password) {
		Query q = createQuery("select a from Admin a where a.userName=:userName and a.password = :password");
		q.setString("userName", userName);
		q.setString("password", password);
		return (Admin) q.uniqueResult();
	}	
}
